package com.example.back.jpa;

import com.example.common.entity.SupervisionLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface SupervisionLogRepository  extends JpaRepository<SupervisionLog,Long>{
    @Query(value = "select max(send_trade_num_nvarchar) from h_supervision_log where send_trade_num_nvarchar like CONCAT(?1,'%')",nativeQuery = true)    
    String findLastTradeNum(String tradeNum);

    @Query(value = "select count(1) from h_supervision_log where send_trade_num_nvarchar = ?1",nativeQuery = true)    
    int findExists(String tradeNum);
}
